/// <reference path="..\\..\\Layouts\\Dunite.InfoRoad\\Script\\knockout.d.ts" />
/// <reference path="..\\..\\Layouts\\Dunite.InfoRoad\\Script\\IViewModel.ts" />

// Module
window["DuniteViewModel"]  = "Model.ViewModel0";
window["DuniteViewModel2"]  = "Model.ViewModel0";
module Model {

    // Class
    export class ViewModel0 implements IViewModel  {
        
        public Apply(formObject: any) {
            var self = formObject.FaultReport;
        
            self.HideShow.test = ko.computed(function () {
                return (this.FaultReportType() == "11");
            }, formObject.FaultReport);

            self.HideShow.BelysningSection = ko.computed(function () {
                return (this.FaultReportType() == "1");
            }, formObject.FaultReport);

            self.HideShow.DescriptionSection = ko.computed(function () {
                return ((this.FaultReportType() != "1") && (this.FaultReportType() != "11"));
            }, formObject.FaultReport);

            self.HideShow.CarSection = ko.computed(function () {
                return (this.FaultReportType() == "11");
            }, formObject.FaultReport);
        }

        public Save()
        { }

        public Cancel()
        { }

        public Publish()
        { }
    }

}

